/**
 * Copyright 厦门中软海晟信息技术有限公司 版权所有 违者必究 2019
 */
package com.opencvjava.practise;

import org.opencv.core.Mat;
import org.springframework.stereotype.Service;

import static com.opencvjava.support.util.CvUtils.imshow;
import static com.opencvjava.support.util.CvUtils.mat;
import static org.opencv.imgcodecs.Imgcodecs.IMREAD_GRAYSCALE;

/**
 *
 *@author : sunzb
 *@date: 2019/7/16
 */
@Service
public class Test2 {

    public void test() {
        Mat gray = mat("lena.jpg", IMREAD_GRAYSCALE);
        imshow("源图", gray);
        int rows = gray.rows();
        int cols = gray.cols();
        int total = (int) gray.total();
        for (int row = 0; row < rows; row++)
            for (int col = 0; col < cols; col++) {

            }
    }

    static class Pixel {
        int row;
        int col;
        int compareColor;
        // 0 初始，1 访问过
        int state;

        public int getState() {
            return state;
        }

        public Pixel setState(int state) {
            this.state = state;
            return this;
        }

        public int getRow() {
            return row;
        }

        public Pixel setRow(int row) {
            this.row = row;
            return this;
        }

        public int getCol() {
            return col;
        }

        public Pixel setCol(int col) {
            this.col = col;
            return this;
        }

        public int getCompareColor() {
            return compareColor;
        }

        public Pixel setCompareColor(int compareColor) {
            this.compareColor = compareColor;
            return this;
        }
    }
}
